package mysql.work01;

import java.time.LocalDateTime;

public class TransactionRecord {
    private int tranId;
    private LocalDateTime timestamp;
    private TransactionType transType;
    private double transAmount;
    private String counterpartyAccount;//对方账户
    private double postBalance;//交易后余额
    public TransactionRecord(){}

    public TransactionRecord(int tranId, LocalDateTime timestamp, TransactionType transType, double transAmount, String counterpartyAccount) {
        this.tranId = tranId;
        this.timestamp = timestamp;
        this.transType = transType;
        this.transAmount = transAmount;
        this.counterpartyAccount = counterpartyAccount;
    }

    public double getPostBalance() {
        return postBalance;
    }

    public void setPostBalance(double postBalance) {
        this.postBalance = postBalance;
    }

    public int getTranId() {
        return tranId;
    }

    public void setTranId(int tranId) {
        this.tranId = tranId;
    }

    public LocalDateTime getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(LocalDateTime timestamp) {
        this.timestamp = timestamp;
    }

    public TransactionType getTransType() {
        return transType;
    }

    public void setTransType(TransactionType transType) {
        this.transType = transType;
    }

    public double getTransAmount() {
        return transAmount;
    }

    public void setTransAmount(double transAmount) {
        this.transAmount = transAmount;
    }

    public String getCounterpartyAccount() {
        return counterpartyAccount;
    }

    public void setCounterpartyAccount(String counterpartyAccount) {
        this.counterpartyAccount = counterpartyAccount;
    }

    @Override
    public String toString() {
        return "TransactionRecord{" +
                "tranId=" + tranId +
                ", timestamp=" + timestamp +
                ", transType=" + transType +
                ", transAmount=" + transAmount +
                '}';
    }
}
